<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../taglibs.jsp" %>
<script type="text/javascript">



function closeWin(){
	parentDialog.close();
}

function changeStore(orderDeatilId,productId,surplus){
	

	var diag = new Dialog();
	diag.Width = 400;
	diag.Height = 200;
	diag.Title = "审核备注";
	
	diag.URL = "${path}/store_chastore?productId="+productId+"&surplus="+surplus+"&orderModel.orderDeatilId="+orderDeatilId;
	diag.OKEvent = function(){
		 var doc=diag.innerFrame.contentWindow;
			//alert(doc.age)
			var result = doc.inStock(orderDeatilId);
			if(result == "yes"){
				diag.close();
				var orderId = $("#orderId").val();
				alert(orderId);
				window.location.href="${path}/store_inDetail?orderModel.orderId="+orderId;
			} 
	}
		
		
		
		
		
		
		
	
	diag.show();
	
}
</script>

<div class="content-right">
	<div class="content-r-pic_w">
		<div style="margin:8px auto auto 12px;margin-top:6px">
			<span class="page_title">进货审核</span>
		</div>
	</div>
	
	<div class="content-text">
			<div class="square-o-top">
				<input type="hidden" id="orderId" value="<s:property value="orderModel.orderId"/>">
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					style="font-size:14px; font-weight:bold; font-family:"黑体";">
					
					<tr>
						<td height="30">企业名称:</td>
						<td class="order_show_msg"><s:property value="orderModel.supplier.name"/></td>
						<td>下单时间:</td>
						<td class="order_show_msg"><s:property value="orderModel.createTime"/></td>
						<td>下 单 人:</td>
						<td class="order_show_msg"><s:property value="orderModel.orderCreater.name"/></td>
						<td>订 单 号:</td>
						<td class="order_show_msg" colspan="2"><s:property value="orderModel.orderNum"/></td>
					</tr>
					<tr>
						<td height="30">订单类别:</td>
						<td class="order_show_msg"><e:getTxt type="orderType" value="${orderModel.orderType }"></e:getTxt></td>
						<td>订单状态:</td>
						<td class="order_show_msg"><e:getTxt type="orderState" value="${orderModel.orderState }"></e:getTxt></td>
						<td>商品总量:</td>
						<td class="order_show_msg"><s:property value="orderModel.totalNum"/></td>
						<td>订单总额:</td>
						<td class="order_show_msg"><s:property value="orderModel.totalPrice"/> 元</td>
					</tr>
				</table>
			</div>
			<!--"square-o-top"end-->
			<div class="square-order">
				<center style="text-decoration:underline;font-size:16px; font-weight:bold; font-family:"黑体";">&nbsp;&nbsp;&nbsp;&nbsp;订&nbsp;&nbsp;单&nbsp;&nbsp;明&nbsp;&nbsp;细&nbsp;&nbsp;&nbsp;&nbsp;</center>
				<br/>
				<table width="100%" border="1" cellpadding="0" cellspacing="0">
					<tr align="center"
						style="background:url(${path}/images/table_bg.gif) repeat-x;">
						<td width="20%" height="30">商品类别</td>
						<td width="20%">商品名称</td>
						<td width="20%">商品总数量</td>
						<td width="20%">商品剩余量</td>
						<td width="20%">已入库</td>
						<td width="20%">操作</td>
					</tr>	
					<s:iterator value="orderModel.ods" var="od">
						<tr align="center" bgcolor="#FFFFFF">
							<td height="30"><s:property value="#od.product.productType.name"/></td>
							<td><s:property value="#od.product.name"/></td>
							<td><s:property value="#od.detailNum"/></td>
							<td><s:property value="#od.surplus"/></td>
							<td><s:property value="#od.detailNum - #od.surplus"/></td>
							<td><input type="button" value="选择仓库" onclick="changeStore(<s:property value="#od.orderDetailId"/>,<s:property value="#od.product.productId"/>,<s:property value="#od.surplus"/>)"></td>
							
						</tr>
					</s:iterator>
					
					
				</table>
				<br/>
				<div style="text-align: right;">
					<table width="100%">
					<tr>
						
						<%-- <td align="center">
							<input type="button" value="驳回" onclick="audit('<s:property value="orderModel.orderId"/>',3)">
							<input type="button" value="通过" onclick="audit('<s:property value="orderModel.orderId"/>',2)">
							<input type="button" value="关闭" onclick="closeWin()">
						</td> --%>
					</tr>
				</table>
				</div>
				
			</div>
	</div>
	<div class="content-bbg"></div>
</div>
